//
//  UIButton+Extension.swift
//  WeiBoSwift
//
//  Created by rong on 15/7/5.
//  Copyright © 2015年 rong. All rights reserved.
//

import UIKit

extension UIButton {

    //方法的参数最好不要太多
    convenience init(title: String, fontSize: CGFloat, titleColor: UIColor = UIColor.whiteColor(), bgColor: UIColor = UIColor.brownColor()){
        //为什么这里不能用self
       // super.init()
        
        self.init()
        
        setTitle(title, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        setTitleColor(titleColor, forState: UIControlState.Normal)
        backgroundColor = bgColor
    }
    
    
}